﻿using System.Windows;
using Tx.OCC.UI;

namespace IE_WPF_WinForms
{
    public enum Material
    {
        Brass,
        Bronze,
        Copper,
        Gold,
        Pewter,
        Plaster,
        Plastic,
        Silver
    }

    /// <summary>
    /// Interaction logic for MaterialDlg.xaml
    /// </summary>
    public partial class MaterialDlg : Window
    {
        public MaterialDlg(OcctProxy theView)
        {
            this.InitializeComponent();

            if (theView == null)
            {
                MessageBox.Show("Fatal Error during the graphic initialisation", "Error!");
            }

            View = theView;

            SetInitialState();
        }

        public OcctProxy View { get; private set; }

        private void PlasterBtn_Checked(object sender, RoutedEventArgs e)
        {
            View.SetMaterial((int)Material.Plaster);
            View.UpdateCurrentViewer();
        }

        private void BrassBtn_Checked(object sender, RoutedEventArgs e)
        {
            View.SetMaterial((int)Material.Brass);
            View.UpdateCurrentViewer();
        }

        private void BronzeBtn_Checked(object sender, RoutedEventArgs e)
        {
            View.SetMaterial((int)Material.Bronze);
            View.UpdateCurrentViewer();
        }

        private void CopperBtn_Checked(object sender, RoutedEventArgs e)
        {
            View.SetMaterial((int)Material.Copper);
            View.UpdateCurrentViewer();
        }

        private void GoldBtn_Checked(object sender, RoutedEventArgs e)
        {
            View.SetMaterial((int)Material.Gold);
            View.UpdateCurrentViewer();
        }

        private void PewterBtn_Checked(object sender, RoutedEventArgs e)
        {
            View.SetMaterial((int)Material.Pewter);
            View.UpdateCurrentViewer();
        }

        private void PlasticBtn_Checked(object sender, RoutedEventArgs e)
        {
            View.SetMaterial((int)Material.Plastic);
            View.UpdateCurrentViewer();
        }

        private void SilverBtn_Checked(object sender, RoutedEventArgs e)
        {
            View.SetMaterial((int)Material.Silver);
            View.UpdateCurrentViewer();
        }

        private void SetInitialState()
        {
            // TODO
        }
    }
}